package com.example.anju.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.anju.entity.Information;
import com.example.anju.entity.Result;
import com.example.anju.service.InformationService;

@RestController
@RequestMapping("information")
public class InformationController {
	@Autowired
	private InformationService informationService;

	// 创建个人信息
	@PostMapping("/newInformation")
	public Result newInformation(@RequestBody Information information) {
		return informationService.newInformationById(information);
	}

	// 查看个人信息
	@PostMapping("/findInformation")
	public Result findInformationById(@RequestBody Information information) {
		return informationService.findInformationById(information);
	}

	// 修改个人信息
	@PostMapping("/postInformation")
	public Result postInformationById(@RequestBody Information information) {
		return informationService.postInformationById(information);
	}
	
}
